<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>涛哥看盘</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="./source/lockmain.css" type="text/css">
</head>
<body>
    <div class="content">

        <img src="./source/pd.png" alt="主产品">
        <a target="_blank" href="https://lesson.homeway.com.cn/play/1027787.html?header=false&mark=28370489&mark1=7030818258_wechat"><div class="play-fpg"></div>
        <img id="playbtn" class="playbtn" src="./source/play.png" alt="播放"></a>
        <a target="_blank" href="https://lesson.homeway.com.cn/play/1027787_1033047.html?mark1=7030818258_wechat&header=false"><img id="hbtn1" class="hbtn" src="./source/btnp.png" alt="播放"></a>
        <a target="_blank" href="https://lesson.homeway.com.cn/play/1027787_1034030.html?mark1=7030818258_wechat&header=false"><img id="hbtn2" class="hbtn" src="./source/btnp.png" alt="播放"></a>
        <a target="_blank" href="https://lesson.homeway.com.cn/play/1027787_1034386.html?mark1=7030818258_wechat&header=false"><img id="hbtn3" class="hbtn" src="./source/btnp.png" alt="播放"></a>
        <a target="_blank" href="https://buy.homeway.com.cn/order/package?header=false&groupid=6001711"><img id="pbtn1" class="pbtn" src="./source/pbtny.png" alt="播放"></a>
        <a target="_blank" href="https://buy.homeway.com.cn/order/package?header=false&groupid=6001713"><img id="pbtn2" class="pbtn" src="./source/pbtny.png" alt="播放"></a>
        <a target="_blank" href="https://buy.homeway.com.cn/order/package?header=false&groupid=6001714"><img id="pbtn3" class="pbtn" src="./source/pbtnb.png" alt="播放"></a>
        <a target="_blank" href="https://buy.homeway.com.cn/order/package?header=false&groupid=6001711"><img id="btngo" class="btngo" src="./source/btngo.png" alt="播放"></a>
    </div>
    <script type="text/javascript" src="../js/jquery-3.5.1.min.js"></script>
    <script type="text/javascript">
        window.onload = function(){
            let PLAYBTNTOP = 0.1754715875805507;          // 播放按钮top比
            let PLAYBTN_WH_RATIO = 1;                       // 播放按钮宽高比
            let PLAYBTN_HALL_RATIO = 0.0187463386057411;  // 播放按钮高占全高比

            let HBTNTOP = 0.2819198594024605;          // 历史播放按钮top比
            let HBTNTOP2 = 0.3251398594024605;          // 历史播放按钮2top比
            let HBTNTOP3 = 0.3679990594024605;          // 历史播放按钮3top比
            let HBTNRIGHT = 0.2066666666666667;         // 历史播方案牛right比
            let HBTN_WH_RATIO = 1;                       // 播放按钮宽高比
            let HBTN_HALL_RATIO = 0.0137668424135911;  // 播放按钮高占全高比

            let PBTNTOP = 0.5940198594024605;          // 产品购买按钮top比
            let PBTNTOP2 = 0.6745598594024605;          // 产品购买按钮2top比
            let PBTNTOP3 = 0.7439598594024605;          // 产品购买按钮3top比
            let PBTNRIGHT = 0.2166666666666667;         // 产品购买按钮right比
            let PBTN_WH_RATIO = 3.878787878787879;      // 产品购买按钮宽高比
            let PBTN_HALL_RATIO = 0.0096660808435852;  // 产品购买按钮高占全高比

            let BBTNTOP = 0.9180198594024605;          // 产品购买按钮top比
            let BBTNRIGHT = 0.2099666666666667;         // 产品购买按钮right比
            let BBTN_WH_RATIO = 0.9518072289156627;      // 产品购买按钮宽高比
            let BBTN_HALL_RATIO = 0.0243116578793204;  // 产品购买按钮高占全高比

            let VBGTOP = 0.1259814169570267;          // 播放区域top比
            let VBGRIGHT = 0.25;         // 产品购买按钮right比
            let VBG_WH_RATIO = 7.6;      // 产品购买按钮宽高比
            let VBG_HALL_RATIO = 0.1139210220673635;  // 产品购买按钮高占全高比

            var dh = document.body.clientHeight;
            var dw = document.body.clientWidth;
            var playbtnTop = $("#playbtn").offset().top;
            var btnPlayW = $("#playbtn").width();
            var btnPlayH = $("#playbtn").height();

            var hbtnTop = $("#hbtn1").offset().top;
            var hbtnRight = $("#hbtn1").offset().right;
            var hbtnW = $("#hbtn1").width();
            var hbtnH = $("#hbtn1").height();

            var hbtnTop2 = $("#hbtn2").offset().top;
            var hbtnRight2 = $("#hbtn2").offset().right;
            var hbtnW2 = $("#hbtn2").width();
            var hbtnH2 = $("#hbtn2").height();

            var hbtnTop3 = $("#hbtn3").offset().top;
            var hbtnRight3 = $("#hbtn3").offset().right;
            var hbtnW3 = $("#hbtn3").width();
            var hbtnH3 = $("#hbtn3").height();

            var pbtnTop = $("#pbtn1").offset().top;
            var pbtnRight = $("#pbtn1").offset().right;
            var pbtnW = $("#pbtn1").width();
            var pbtnH = $("#pbtn1").height();

            var pbtnTop2 = $("#pbtn2").offset().top;
            var pbtnRight2 = $("#pbtn2").offset().right;
            var pbtnW2 = $("#pbtn2").width();
            var pbtnH2 = $("#pbtn2").height();

            var pbtnTop3 = $("#pbtn3").offset().top;
            var pbtnRight3 = $("#pbtn3").offset().right;
            var pbtnW3 = $("#pbtn3").width();
            var pbtnH3 = $("#pbtn3").height();

            var bbtnTop = $("#btngo").offset().top;
            var bbtnRight = $("#btngo").offset().right;
            var bbtnW = $("#btngo").width();
            var bbtnH = $("#btngo").height();

            var vbgTop = $(".play-fpg").offset().top;
            var vbgRight = $(".play-fpg").offset().right;
            var vbgW = $(".play-fpg").width();
            var vbgH = $(".play-fpg").height();

            $(document).ready(function(){//在文档加载完毕后执行

                $("#playbtn").css("display", "block");

                btnPlayH = dh * PLAYBTN_HALL_RATIO;
                btnPlayW = btnPlayH * PLAYBTN_WH_RATIO;
                playbtnTop = PLAYBTNTOP * dh;
                $("#playbtn").css("width", btnPlayW);
                $("#playbtn").css("height", btnPlayH);
                $("#playbtn").css("top", playbtnTop);
                $("#playbtn").css("margin-left", -btnPlayW*0.5);

                hbtnH = dh * HBTN_HALL_RATIO;
                hbtnW = hbtnH * HBTN_WH_RATIO;
                hbtnTop = HBTNTOP * dh;
                hbtnRight = HBTNRIGHT * dw;
                $("#hbtn1").css("width", hbtnW);
                $("#hbtn1").css("height", hbtnH);
                $("#hbtn1").css("top", hbtnTop);
                $("#hbtn1").css("right", hbtnRight);

                hbtnH2 = dh * HBTN_HALL_RATIO;
                hbtnW2 = hbtnH * HBTN_WH_RATIO;
                hbtnTop2 = HBTNTOP2 * dh;
                hbtnRight2 = HBTNRIGHT * dw;
                $("#hbtn2").css("width", hbtnW2);
                $("#hbtn2").css("height", hbtnH2);
                $("#hbtn2").css("top", hbtnTop2);
                $("#hbtn2").css("right", hbtnRight2);

                hbtnH3 = dh * HBTN_HALL_RATIO;
                hbtnW3 = hbtnH * HBTN_WH_RATIO;
                hbtnTop3 = HBTNTOP3 * dh;
                hbtnRight3 = HBTNRIGHT * dw;
                $("#hbtn3").css("width", hbtnW3);
                $("#hbtn3").css("height", hbtnH3);
                $("#hbtn3").css("top", hbtnTop3);
                $("#hbtn3").css("right", hbtnRight3);

                pbtnH = dh * PBTN_HALL_RATIO;
                pbtnW = pbtnH * PBTN_WH_RATIO;
                pbtnTop = PBTNTOP * dh;
                pbtnRight = PBTNRIGHT * dw;
                $("#pbtn1").css("width", pbtnW);
                $("#pbtn1").css("height", pbtnH);
                $("#pbtn1").css("top", pbtnTop);
                $("#pbtn1").css("right", pbtnRight);

                pbtnH2 = dh * PBTN_HALL_RATIO;
                pbtnW2 = pbtnH2 * PBTN_WH_RATIO;
                pbtnTop2 = PBTNTOP2 * dh;
                pbtnRight2 = PBTNRIGHT * dw;
                $("#pbtn2").css("width", pbtnW2);
                $("#pbtn2").css("height", pbtnH2);
                $("#pbtn2").css("top", pbtnTop2);
                $("#pbtn2").css("right", pbtnRight2);

                pbtnH3 = dh * PBTN_HALL_RATIO;
                pbtnW3 = pbtnH3 * PBTN_WH_RATIO;
                pbtnTop3 = PBTNTOP3 * dh;
                pbtnRight3 = PBTNRIGHT * dw;
                $("#pbtn3").css("width", pbtnW3);
                $("#pbtn3").css("height", pbtnH3);
                $("#pbtn3").css("top", pbtnTop3);
                $("#pbtn3").css("right", pbtnRight3);

                bbtnH = dh * BBTN_HALL_RATIO;
                bbtnW = bbtnH * BBTN_WH_RATIO;
                bbtnTop = BBTNTOP * dh;
                bbtnRight = BBTNRIGHT * dw;
                $("#btngo").css("width", bbtnW);
                $("#btngo").css("height", bbtnH);
                $("#btngo").css("top", bbtnTop);
                $("#btngo").css("right", bbtnRight);

                vbgTop = VBGTOP * dh;
                vbgRight = VBGRIGHT * dw;
                vbgW = bbtnH * VBG_WH_RATIO;
                vbgH = dh * VBG_HALL_RATIO;
                $(".play-fpg").css("width", vbgW);
                $(".play-fpg").css("height", vbgH);
                $(".play-fpg").css("top", vbgTop);
                $(".play-fpg").css("right", vbgRight);

                var onResize = function() {
                    var dh = document.body.clientHeight;
                    var dw = document.body.clientWidth;
                    console.log("dh: " + dh);
                    btnPlayH = dh * PLAYBTN_HALL_RATIO;
                    btnPlayW = btnPlayH * PLAYBTN_WH_RATIO;
                    playbtnTop = PLAYBTNTOP * dh;

                    hbtnH = dh * HBTN_HALL_RATIO;
                    hbtnW = hbtnH * HBTN_WH_RATIO;
                    hbtnTop = HBTNTOP * dh;
                    hbtnRight = HBTNRIGHT * dw;

                    hbtnH2 = dh * HBTN_HALL_RATIO;
                    hbtnW2 = hbtnH * HBTN_WH_RATIO;
                    hbtnTop2 = HBTNTOP2 * dh;
                    hbtnRight2 = HBTNRIGHT * dw;

                    hbtnH3 = dh * HBTN_HALL_RATIO;
                    hbtnW3 = hbtnH * HBTN_WH_RATIO;
                    hbtnTop3 = HBTNTOP3 * dh;
                    hbtnRight3 = HBTNRIGHT * dw;

                    pbtnH = dh * PBTN_HALL_RATIO;
                    pbtnW = pbtnH * PBTN_WH_RATIO;
                    pbtnTop = PBTNTOP * dh;
                    pbtnRight = PBTNRIGHT * dw;

                    pbtnH2 = dh * PBTN_HALL_RATIO;
                    pbtnW2 = pbtnH2 * PBTN_WH_RATIO;
                    pbtnTop2 = PBTNTOP2 * dh;
                    pbtnRight2 = PBTNRIGHT * dw;

                    pbtnH3 = dh * PBTN_HALL_RATIO;
                    pbtnW3 = pbtnH3 * PBTN_WH_RATIO;
                    pbtnTop3 = PBTNTOP3 * dh;
                    pbtnRight3 = PBTNRIGHT * dw;

                    bbtnH = dh * BBTN_HALL_RATIO;
                    bbtnW = bbtnH * BBTN_WH_RATIO;
                    bbtnTop = BBTNTOP * dh;
                    bbtnRight = BBTNRIGHT * dw;

                    vbgTop = VBGTOP * dh;
                    vbgRight = VBGRIGHT * dw;
                    vbgW = bbtnH * VBG_WH_RATIO;
                    vbgH = dh * VBG_HALL_RATIO;

                    $("#playbtn").css("width", btnPlayW);
                    $("#playbtn").css("height", btnPlayH);
                    $("#playbtn").css("top", playbtnTop);
                    $("#playbtn").css("margin-left", -btnPlayW*0.5);

                    $("#hbtn1").css("width", hbtnW);
                    $("#hbtn1").css("height", hbtnH);
                    $("#hbtn1").css("top", hbtnTop);
                    $("#hbtn1").css("right", hbtnRight);

                    $("#hbtn2").css("width", hbtnW2);
                    $("#hbtn2").css("height", hbtnH2);
                    $("#hbtn2").css("top", hbtnTop2);
                    $("#hbtn2").css("right", hbtnRight2);

                    $("#hbtn3").css("width", hbtnW3);
                    $("#hbtn3").css("height", hbtnH3);
                    $("#hbtn3").css("top", hbtnTop3);
                    $("#hbtn3").css("right", hbtnRight3);

                    $("#pbtn1").css("width", pbtnW);
                    $("#pbtn1").css("height", pbtnH);
                    $("#pbtn1").css("top", pbtnTop);
                    $("#pbtn1").css("right", pbtnRight);

                    $("#pbtn2").css("width", pbtnW2);
                    $("#pbtn2").css("height", pbtnH2);
                    $("#pbtn2").css("top", pbtnTop2);
                    $("#pbtn2").css("right", pbtnRight2);

                    $("#pbtn3").css("width", pbtnW3);
                    $("#pbtn3").css("height", pbtnH3);
                    $("#pbtn3").css("top", pbtnTop3);
                    $("#pbtn3").css("right", pbtnRight3);

                    $("#btngo").css("width", bbtnW);
                    $("#btngo").css("height", bbtnH);
                    $("#btngo").css("top", bbtnTop);
                    $("#btngo").css("right", bbtnRight);

                    $(".play-fpg").css("width", vbgW);
                    $(".play-fpg").css("height", vbgH);
                    $(".play-fpg").css("top", vbgTop);
                    $(".play-fpg").css("right", vbgRight);
                }

                window.onresize=onResize;

                const $ScrollWrap = $(window);
                // 监听滚动停止
                let t1 = 0;
                let t2 = 0;
                let timer = null; // 定时器
                $ScrollWrap.on("touchstart", function(){
                    // 触摸开始 ≈ 滚动开始
                })
                $ScrollWrap.on("scroll", function(){
                    // 滚动
                    clearTimeout(timer);
                    timer = setTimeout(isScrollEnd, 100);
                    t1 = $ScrollWrap.scrollTop();

                })
                function isScrollEnd() {
                    t2 = $ScrollWrap.scrollTop();
                    if(t2 == t1){
                        clearTimeout(timer);
                    }
                }

            })
        }
    </script>
</body>
</html>